package
{
	import flash.events.KeyboardEvent;

	public class KeyManager
	{
		private static var _keys:Array = new Array();

		public static function onKeyDown(event:KeyboardEvent):void
		{
			if (KeyManager._keys.indexOf(event.keyCode) == -1)
			{
				KeyManager. _keys.push(event.keyCode);
			}
		}

		public static function onKeyUp(event:KeyboardEvent):void
		{
			var i:int = KeyManager._keys.indexOf(event.keyCode);
			if (i > -1)
			{
				KeyManager. _keys.splice(i, 1);
			}
		}

		public static function isDown(key:int):Boolean
		{
			return KeyManager._keys.indexOf(key) > -1;
		}
	}
}
